package com.lemon.exam.service;

import com.lemon.exam.common.crud.BaseService;
import com.lemon.exam.common.entity.vo.SSEMessageVO;
import com.lemon.exam.common.entity.vo.TreeSelectVO;
import com.lemon.exam.entity.po.PaperPO;
import com.lemon.exam.entity.vo.PaperQuestionVO;
import com.lemon.exam.entity.vo.PaperVO;
import org.springframework.http.codec.multipart.FilePart;
import org.springframework.http.server.reactive.ServerHttpResponse;
import reactor.core.publisher.Flux;
import reactor.core.publisher.Mono;

import java.time.LocalDateTime;
import java.util.List;
import java.util.Map;

/**
 * 试卷表 服务接口
 *
 * @author Lemon
 * @since 2025/05/11 13:47:13
 */
public interface IPaperService extends BaseService<PaperPO, Long> {
    Mono<Map<String, Object>> upload(FilePart filePart);

    Flux<TreeSelectVO> findClassSelect();

    Mono<Void> exportTemplate(ServerHttpResponse response);

    Mono<Void> download(Long id, ServerHttpResponse response);

    Mono<List<PaperQuestionVO>> findPaperQuestion(Long id);

    Flux<PaperVO> findPaddingPaperByAnswerUser(int pageNum, int pageSize);

    Flux<PaperVO> findFinishPaperByAnswerUser(int pageNum, int pageSize);

    Flux<PaperVO> findNotFillPaperByAnswerUser(int pageNum, int pageSize);

    Flux<PaperVO> findPaddingPaperByGradingUser(int pageNum, int pageSize);

    Flux<PaperVO> findFinishPaperByGradingUser(int pageNum, int pageSize);

    Mono<PaperPO> findPaperById(Long id);

    Mono<LocalDateTime> findEndTimeById(Long id);

    Mono<PaperPO> findPassScoreFilePathByAnswerId(Long answerId);

    Flux<SSEMessageVO> generatePaper(Map<String, Object> param, String token);
}
